﻿Imports Microsoft.Practices.EnterpriseLibrary.Data
Imports Seuss.EnterpriseLibrary.DataAccess
Imports Seuss.EnterpriseLibrary.BusinessLogic
Imports System.Web
Imports System.Data

Partial Class Consulta_AL_InfoEcon_TasaEdu
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Response.Expires = -1
        Response.AddHeader("Pragma", "no-cache")
        Response.AddHeader("cache-control", "private")
        Response.CacheControl = "no-cache"
        If Not Page.IsPostBack Then
            Call CargarUO_By_cPerCodigo(IdentityUser.UserCode)
            Using Seguridad As New BLL_Administracion
                Seguridad.Set_Transaccion_Insert(Nothing, 100401, IdentityUser.UserCode, My.Request.UserHostAddress.ToString, CrearXMLTransaccion("Consulta Pagina Movil", "/Pagina|" + My.Request.Url.Segments(My.Request.Url.Segments.Length - 1).ToString))
            End Using
        End If
    End Sub

    Private Sub CargarUO_By_cPerCodigo(ByVal cPerCodigo As Long)
        Dim ldr As New List(Of IDataReader)
        Dim DivPrincipal As New StringBuilder
        Dim Asignatura As String = ""

        DivPrincipal.Append("<div class='listview'> <ul>")

        Using ObjPool As New PoolDbCommand()
            Dim ObjUsuario As New DAL_Kiosco(ObjPool.Database)
            ObjPool.AddDbCommand(ObjUsuario.Get_Filial_By_cPerCodigo(cPerCodigo), PoolDbCommand.PoolDbCommandResultType.Query)
            ObjPool.Pooling(Nothing, ldr, True)
            ObjUsuario = Nothing
            If ldr.Count > 1 Then
                While ldr(0).Read
                    DivPrincipal.Append(" <li><a href='./AL_InfoEcon_TasaEdu_Contenido.aspx?cPerJuridica=" + ldr(0).Item("cPerJuridica").ToString + "'>" + ldr(0).Item("cPerApellido").ToString + "<span></span></a></li>")
                End While
            Else
                While ldr(0).Read
                    Response.Redirect("~/consulta/AL_InfoEcon_TasaEdu_Contenido.aspx?cPerJuridica=" + ldr(0).Item("cPerJuridica").ToString)
                End While
            End If
            
        End Using

        DivPrincipal.Append("</ul></div>")
        lblUO.Text = DivPrincipal.ToString
    End Sub
End Class
